package m2;

import java.util.ArrayList;
import java.util.HashMap;

import m2.attachement.AttachementRFPR;
import m2.attachement.AttachementRRPF;
import m2.binding.BindingF;
import m2.binding.BindingR;
import m2.connecteur.Connecteur;
import m2.port.PortConfigFourni;
import m2.port.PortConfigRequis;

public class Configuration extends Element {
	protected HashMap<String, BindingF> bindingF;
	protected HashMap<String, BindingR> bindingR;
	protected HashMap<String, Composant> composantMap;
	protected HashMap<String, Connecteur> connecteurMap;
	protected ArrayList<AttachementRRPF> attachementRRPFs;
	protected ArrayList<AttachementRFPR> attachementRFPRs;
	protected HashMap<String, PortConfigRequis> portConfigRMap;
	protected HashMap<String, PortConfigFourni> portConfigFMap;

	public Configuration(String name) {
		super(name);
		// TODO Auto-generated constructor stub
		bindingF = new HashMap<String, BindingF>();
		bindingR = new HashMap<String, BindingR>();
		composantMap = new HashMap<String, Composant>();
		connecteurMap = new HashMap<String, Connecteur>();
		attachementRRPFs = new ArrayList<AttachementRRPF>();
		attachementRFPRs = new ArrayList<AttachementRFPR>();
		portConfigRMap = new HashMap<String, PortConfigRequis>();
		portConfigFMap = new HashMap<String, PortConfigFourni>();

	}

	public void addBindingF(BindingF b) {
		this.bindingF.put(b.getName(), b);
	}

	public void addBindingR(BindingR b) {
		this.bindingR.put(b.getName(), b);
	}

	public void addComposant(Composant c) {
		this.composantMap.put(c.getName(), c);
	}

	public void addConnecteur(Connecteur connecteur) {
		this.connecteurMap.put(connecteur.getName(), connecteur);
	}

	public void addAttachementRFPR(AttachementRFPR attachementRFPR) {
		this.attachementRFPRs.add(attachementRFPR);
	}

	public void addAttachementRRPF(AttachementRRPF attachementRRPF) {
		this.attachementRRPFs.add(attachementRRPF);
	}


	public void addPortConfigR(PortConfigRequis portConfigRequis) {
		portConfigRMap.put(portConfigRequis.getName(), portConfigRequis);
	}

	protected void addPortConfigF(PortConfigFourni portConfigFourni) {
		portConfigFMap.put(portConfigFourni.getName(), portConfigFourni);

	}

	public HashMap<String, BindingF> getBindingF() {
		return bindingF;
	}

	public HashMap<String, BindingR> getBindingR() {
		return bindingR;
	}

	public HashMap<String, Composant> getComposantMap() {
		return composantMap;
	}

	public HashMap<String, Connecteur> getConnecteurMap() {
		return connecteurMap;
	}

	public ArrayList<AttachementRRPF> getAttachementRRPFs() {
		return attachementRRPFs;
	}

	public ArrayList<AttachementRFPR> getAttachementRFPRs() {
		return attachementRFPRs;
	}

	public HashMap<String, PortConfigRequis> getPortConfigRMap() {
		return portConfigRMap;
	}

	public HashMap<String, PortConfigFourni> getPortConfigFMap() {
		return portConfigFMap;
	}


	@Override
	public void update(Object o, Object arg) {
		// TODO Auto-generated method stub
		
	}

}
